/**
 * 
 */
package com.tw.trips.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.tw.trips.util.EmailClient;

/**
 * @author M1005264
 *
 */
@Service
@Transactional
public class ItineraryService {

	@Autowired
	private EmailClient mailClient;

	@Autowired
	private TripAlertService tripAlertService;

	@Autowired
	private WeatherAlertService weatherService;
	
	@Scheduled(fixedDelay=60*1000)
	public void pollForItineary() {
		System.out.println("Trying to Pull EMail");
		mailClient.pullEmails();
	}
	
//	@Scheduled(fixedDelay=60*1000)
	public void pollForTravelAlerts() {
//		System.out.println("Trying to Pull Alerts");
//		tripAlertService.getAlerts();
	}
	
//	@Scheduled(fixedDelay=60*1000)
	public void pollForWeatherAlerts() {
		System.out.println("Trying to Pull Weather");
//		weatherService.getAlerts();
	}

}
